package com.st.service;

import com.st.lock.util.RedisLock;
import com.st.mapper.TestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


@Service
public class TestService {
    @Autowired
    private TestMapper testMapper;
    @Autowired
    private RedisLock redisLockTool;

    @Transactional
    public int updateNum(){
        int num = testMapper.getNum();
        num ++;
        testMapper.updateNum(num);
        return num;
    }
}
